package com.atguigu.guli.service.vod.controller.api;

import com.atguigu.guli.service.base.result.R;
import com.atguigu.guli.service.vod.service.VodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RequestMapping("/api/vod")

@RestController
public class ApiVodController {
    @Autowired
    VodService vodService;
    //3、用户 获取视频播放凭证和播放地址
    @GetMapping("getPlayUrl/{videoId}")
    public R getPlayUrl(@PathVariable String videoId){
        String playUrl = vodService.getPlayUrl(videoId);
        return R.ok().data("playUrl" , playUrl);
    }
    @GetMapping("getPlayAuth/{videoId}")
    public R getPlayAuth(@PathVariable String videoId){
        String playAuth = vodService.getPlayAuth(videoId);
        return R.ok().data("playAuth" , playAuth);
    }
}
